﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageAdmin.master" AutoEventWireup="true"
    CodeFile="sinhvien.aspx.cs" Inherits="Admin_sinhvien" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
   <%-- <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>--%>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="update">
        <ProgressTemplate>
            <div class="jqibox" style="position: absolute; height: 100%; width: 100%; top: 0px;
                left: 0px; right: 0px; bottom: 0px; z-index: 1999;">
                <div id="progress_div">
                    <img src="../images/wati.gif" height="100px" width="100px" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div class="mainy">
        <!-- Page title -->
        <div class="page-title" style="display: none">
            <h2>
                <i class="icon-list color"></i>Form <small>Subtext for header</small></h2>
            <hr>
        </div>
        <!-- Page title -->
        <div class="row">
            <div class="col-md-12">
                <div class="awidget" style="overflow-x: scroll;">
                    <div class="awidget-head">
                        <h3>
                            Sinh viên</h3>
                    </div>
                    <div class="awidget-body">
                        <div class="form-horizontal" role="form">
                            <div class="form-group">
                                <label class="col-lg-2 control-label">
                                    Chọn khoa</label>
                                <div class="col-lg-10">
                                    <asp:DropDownList ID="dr_khoa" runat="server" class="form-control" AutoPostBack="true">
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="awidget-body">
                        <div class="form-horizontal" role="form">
                            <asp:UpdatePanel ID="update" runat="server">
                                <ContentTemplate>
                                    <asp:Label ID="lb_me" runat="server" class="error_c"></asp:Label>
                                    <asp:GridView ID="grid" CssClass="grid_c" runat="server" Width="3000" AutoGenerateColumns="false">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Mã sinh viên">
                                                <ItemTemplate>
                                                    <asp:Label ID="txt_masinhvien" runat="server" Text='<%# Eval("masinhvien") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Họ đệm">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ho" runat="server" Text='<%# Eval("ho") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Tên">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ten" runat="server" Text='<%# Eval("ten") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Ngày sinh">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ngaysinh" runat="server" Text='<%# Eval("ngaysinh") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Giới tính">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="dr_gt" runat="server">
                                                        <asp:ListItem Value="1" Text="Nam"></asp:ListItem>
                                                        <asp:ListItem Value="0" Text="Nữ"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Nơi sinh">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_noisinh" runat="server" Text='<%# Eval("noisinh") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Hộ khẩu">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_hokhau" runat="server" Text='<%# Eval("hokhau") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Dân tộc">
                                                <ItemTemplate>
                                                    <asp:DropDownList runat="server" ID="dr_dt">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Tôn giáo">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_tongiao" runat="server" Text='<%# Eval("tongiao") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Họ Tên bố">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_hotenbo" runat="server" Text='<%# Eval("hotenbo") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="nghề nghiệp bố">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_nnbo" runat="server" Text='<%# Eval("nnbo") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Họ tên mẹ">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_hotenme" runat="server" Text='<%# Eval("hotenme") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Nghề nghiệp mẹ">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_nnme" runat="server" Text='<%# Eval("nnme") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Năm tốt nghiệp 12">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_namtn12" runat="server" Text='<%# Eval("namtn12") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Số hiệu bằng 12">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_sohieubang12" runat="server" Text='<%# Eval("SoHieuBang12") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="CMTND">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_cmtnd" runat="server" Text='<%# Eval("cmtnd") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Ngày cấp">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ngaycap" runat="server" Text='<%# Eval("ngaycap") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Nơi cấp">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_noicap" runat="server" Text='<%# Eval("noicap") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Địa chỉ">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_diachi" runat="server" Text='<%# Eval("diachi") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Điện thoại">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_dienthoai" runat="server" Text='<%# Eval("dienthoai") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Email">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_email" runat="server" Text='<%# Eval("email") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Địa chỉ hiện tại">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_diachiht" runat="server" Text='<%# Eval("diachiht") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Ghi chú">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ghichu" runat="server" Text='<%# Eval("ghichu") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="dr_khoa" EventName="SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </div>
                    </div>
                </div>
                <ul class="pagination pull-right">
                    <asp:Repeater ID="rptPager" runat="server">
                        <ItemTemplate>
                            <li>
                                <asp:LinkButton ID="lnkPage" runat="server" Text='<%#Eval("TABLE_NAME") %>' CommandName="Chuyen"
                                    CommandArgument='<%# Eval("TABLE_NAME") %>'></asp:LinkButton></li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <asp:LinkButton ID="link_add" runat="server" Text="Thêm sinh viên" class="btn btn-primary"
                            OnClick="link_add_Click" Visible="false"></asp:LinkButton>
                        <asp:Button ID="btn_luu" runat="server" class="btn btn-primary" Text="Lưu" Visible=false OnClick="btn_luu_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();

            if (postBackElement.id == 'ContentPlaceHolder1_dr_khoa')
                $get('ContentPlaceHolder1_UpdateProgress1').style.display = 'block';
        }
        function EndRequest(sender, args) {
            if (postBackElement.id == 'ContentPlaceHolder1_dr_khoa')
                $get('ContentPlaceHolder1_UpdateProgress1').style.display = 'none';
        }
    </script>
</asp:Content>
